﻿// --------------------------------
// <copyright file="InlineStringList.cs" company="Faculty of Information Technology, Czech Technical University in Prague">
//     This document is shared by Microsoft Public License (MS-PL)
//     For further details please see http://msdn.microsoft.com/en-us/library/ff648068.aspx or license.txt.
// </copyright>
// <author>Lukáš Molnár</author>

// <email>molnaluk@fit.cvut.cz</email>

// <date>9. 11. 2011 22:22:37</date>

// <summary>
//
// </summary>
// --------------------------------

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace FITClub.TextureMenu
{
#if WINDOWS

    [System.Serializable]
#endif
    /// <summary>
    /// Inline list which displays text.
    /// </summary>
    public class InlineStringList : InlineList<string>
    {
        public string FontPath { get; set; }
#if WINDOWS
        [NonSerialized]
#endif
        private SpriteFont font;

        public override void LoadContent(Microsoft.Xna.Framework.Content.ContentManager loader)
        {
            if (this.ContentLoaded == false)
            {
                this.font = MenuHelper.LoadFontOrDefault(loader, this.FontPath);
            }
            base.LoadContent(loader);
        }

        internal override void DrawItem(Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch, Microsoft.Xna.Framework.Color tint)
        {
            if (this.HasValues)
            {
                MenuHelper.DrawText(spriteBatch, font, this.SelectedValue, this.TextColor, this.Bounds, TextAlignment.Center, this.Resizable);
            }
        }
    }
}